<!DOCTYPE html>
<html lang="en">
<head>
    <title>标签</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=4a6c1b54">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <script src="https://file.ggxqce.com/web/vue.min.js"></script>
    <style>
        [v-cloak] {
            display: none;
        }

        * {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            outline: none;
        }

        body {
            background: #F8F8F8;
        }
        .moduleName {
            height: 27px;
            line-height: 27px;
            font-size: 22px;
            text-align: left;
        }

        .tryStyle {
            width: 30px;
            height: 14px;
            line-height: 14px;
            font-size: 12px;
            /* top: 0; */
            right: 0;
            position: absolute;
            border-radius: 5px;
            margin-top: 1px;
            background: red;
            color: #fff;
            margin-right: -2px;
            transform: scale(0.8);
        }

        .nav-tabs-custom {
            padding: 10px;
            margin-bottom: 0;
            box-shadow: none;
            position: relative;
            overflow: hidden;
        }

        .infoReport {
            display: flex;
            justify-content: flex-start;
            text-align: left;
            margin-left: 10px;
        }

        .infoReport div {
            margin: 0 10px;
        }

        .lineOne {
            text-align: left;
        }

        .lineOne span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        .lineOneNoMore {
            text-align: left;
        }

        .lineOneNoMore span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        .mScrollBox {
            float: left;
            position: relative;
        }

        .imgStyle {
            width: 300px;
            height: 400px;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .templateStyle {
            border: 1px solid #ddd;
            margin-bottom: 10px;
            padding-bottom: 10px;
        }

        .table > thead > tr > th {
            padding: 0;
        }

        .table > tbody > tr > td {
            position: relative;
        }

        table {
            margin-bottom: 0 !important;
        }

        .td-tanZongStyle-line input {
            height: 24px !important;
            box-shadow: inset 1px 1px 4px #333;
            padding-left: 4px !important;
            width: 100%;
        }

        .td-tanZongStyle-line span {
            padding-left: 4px !important;
        }

        .table > thead > tr > th {
            background: #fff;
        }

        .table > thead > tr > .back {
            background: yellow;
        }
        .lefts {
             text-align: center;
             color: #2a8cec;
             background-image: url(/dist/img/tabApp.png);
             margin-left: 8px;
             margin-right: 8px;
             background-size: 100% 100%;
             padding:10px 15px 15px;
         }

        .rights {
            text-align: center;
            color: #fff;
            font-size: 14px;
            /*border-bottom: 2px solid #f8f8f8;*/
            margin-left: 4px;
            margin-right: 4px;
            margin-top: 3px;
            padding-bottom: 5px;
        }

        .slide-box {
            display: -webkit-box;
            overflow-x: scroll;
            overflow-y: hidden;
            -webkit-overflow-scrolling: touch;
            height: 45px;
            line-height: 45px;
            background: #2a8cec;
            float: left;
            padding-left: 35px;
            width:100%;
            position: fixed;
            top: 0;
        }
        .left {
            text-align: center;
            color: #2a8cec;
            border-bottom: 2px solid #2a8cec;
            margin-left: 8px;
            margin-right: 8px;
        }

        .right {
            text-align: center;
            color: #666666;
            font-size: 14px;
            /*border-bottom: 2px solid #f8f8f8;*/
            margin-left: 4px;
            margin-right: 4px;
            padding-top: 5px;
            padding-bottom: 5px;
        }

        .tab {
            background: #fff;
            border-bottom: 1px solid #cbcbcd;
            line-height:45px;
        }
        .tab span{
            padding-left: 4px;
            font-size: 14px;
            padding-right:90px;
        }
        .tabContent {
            display: flex;
            height: 45px;
            line-height: 45px;
            background: #2a8cec;
        }

        .tabContentLeft {
            width: 45px;
        }

        .tabContentRight {
            width: 45px;
        }

        .tabContentMiddle {
            background: #2a8cec;
            flex: 1;
            overflow: hidden;
        }

        .tabActive {
            font-size: 14px;
            text-align: center;
            color: #2a8cec;
            background-image: url(/dist/img/tabApp.png);
            /* margin-left: 8px; */
            /* margin-right: 8px; */
            background-size: 100% 100%;
            /* padding: 10px 15px 15px; */
            float: left;
            height: 38px;
            line-height: 38px;
            margin-top: 9px;
            width: 50%;
        }

        .tabNo {
            text-align: center;
            font-size: 14px;
            color: #fff;
            /* margin-left: 8px; */
            /* margin-right: 8px; */
            background-size: 100% 100%;
            /* padding: 10px 15px 15px; */
            float: left;
            height: 38px;
            line-height: 38px;
            margin-top: 9px;
            width: 50%;
        }
        .tabs{
            position: absolute;
            top:45px;
            left:0;
            width:100%;
        }
    </style>
</head>
<body>
<section class="content" id="app" style="padding: 0px;" v-cloak>
    <div class="div-td-content-more"><i></i></div>
    <div style="background: #2a8cec;" v-if="companyList&&companyList.length>2">
        <!--<div style="width: 45px;position:absolute;top: 0;left: 0;margin-right: 45px;height: 45px;background: #2a8cec;" v-if="companyList&&companyList.length>0"></div>-->
        <div class="slide-box">
            <div v-for="(item,i) in companyList" class="rights">
                <span :class="selectCompany==i? 'lefts':'rights'" style="height: 30px;"
                      @click="selectCompany=i;get_tab(item.companyId)">
                    {{item.companyName}}
                </span>
            </div>
        </div>
    </div>
    <div class="tabContent" v-if="companyList&&companyList.length<=2">
        <div class="tabContentLeft"></div>
        <div class="tabContentMiddle" >
            <div v-for="(item,i) in companyList">
                <span :class="selectCompany==i? 'tabActive':'tabNo'"
                      @click="selectCompany=i;get_tab(item.companyId)">
                        {{item.companyName}}
                </span>
            </div>
        </div>
        <div class="tabContentRight"></div>
    </div>
    <!--获取列表-->
    <div class="tabs">
        <div v-for="(item,i) in list" class="tab" >
            <span @click="openType(item)">{{item.docName}}</span>
            <img src="/dist/img/forward.png" style="width: 25px;float: right;padding-top: 10px;margin-right: 10px;" @click="forward(item)">
        </div>
    </div>
    <div v-if="returnFlag"></div>
    <div v-else>
        <div style="margin: 0 auto;color: #999999;text-align: center;margin-top: 100px;font-size: 22px;" v-if="!list ||list.length<=0">
            暂无配置
        </div>
    </div>
</section>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="/dist/plugins/scroll/myScroll.js"></script>
<!--框架已定义 JS-->
<!--oa自定义  JS-->
<script src="/dist/js/oaApp.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne,.lineTwo", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script>
    $.ajaxSetup({
        global: true,
        type: "POST",
        cache: false,
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        beforeSend: function () {
        },
        complete: function () {

        },
        error: function (e) {
            alert('error' + e.responseText);
        }
    });
    $.extend($.wyui, {
        postMethod: function (url, data, callback, sync, id) {
            if (!id) {
                id = "#app"
            }
            $.ajax({
                url: server.ip + url,
                async: sync ? false : true,
                data: JSON.stringify(data),
                beforeSend: function () {

                },
                complete: function () {
                    setTimeout(function () {
                    }, 1000);

                },
                success: function (r) {
                    if (!r.e.code) {
                        callback(r.data.sendData);
                    } else {
                        alert(r.e.desc);
                    }
                },
                error: function (e) {
                    alert(url + e.responseText);
                }
            });
        },
    });
</script>
<script type="text/javascript">
    var app = new Vue({
        el: '#app',
        data: {
            userId: getUrlParamObj().userId,
            companyId: '',
            companyList:[],
            list:[],
            selectCompany: 0,
            returnFlag: false,
        },
        methods: {
            //获取公司
            get_company: function () {
                var that = this;
                $.wyui.postMethod(urlConfig.main.getCompanyListByUserId, {
                    "userId": that.userId
                }, function (data) {
                    console.log(data)
                    that.companyList = data;
                    that.companyId = that.companyList[0].companyId;
                    that.get_tab(that.companyId);
                });
            },
            //获取部门
            get_tab: function (companyId) {
                var that = this;
                var obj = {
                    dialog: 'show'
                }
                prompt(JSON.stringify(obj))
                $.wyui.postMethod(urlConfig.main.getMainByCompanyId, {
                    "companyId": companyId
                }, function (data) {
                    console.log(data)
                    that.list = data;
                    that.returnFlag = true;
                    var obj = {
                        dialog: 'hidden'
                    }
                    prompt(JSON.stringify(obj))
                });
            },
            //打开基本信息
            openType: function (item) {
                var that = this;
                var obj = {
                    type: item.typeName,
                    forward:'',
                    docBean:JSON.stringify(item)
                }
                prompt(JSON.stringify(obj));
            },
            forward:function (item) {
                var that = this;
                var obj = {
                    type: item.typeName,
                    forward:'1',
                    docBean:JSON.stringify(item)
                }
                prompt(JSON.stringify(obj));
            }
        },
        mounted: function () {
            var that = this;
            that.get_company();
        }
    });

</script>
</body>